#ifndef MQTTCLIENT_H
#define MQTTCLIENT_H

#include <QWidget>
#include "QtMqtt/qmqttclient.h"
#include "QtMqtt/qmqttsubscription.h"
#include "ui_widget.h" // 确保包含 Ui::Widget 的头文件


class MqttClient : public QWidget
{
    Q_OBJECT
public:
    explicit MqttClient(QWidget *parent = nullptr, Ui::Widget *ui = nullptr); // 修改构造函数

public slots:
    void connectSever();

    void subTopic();

    void pubTopic(const QByteArray &message, const QString &topicName, quint8 qos);

private:
    QMqttClient *client;
     Ui::Widget *m_ui; // 添加这个成员变量


signals:

};

#endif // MQTTCLIENT_H
